namespace SimpleSpreadsheet.Core.Expressions
{
    /// <summary>
    /// Represents a binary expression
    /// </summary>
    public class BinaryExpresssion : BaseExpression
    {
        public BinaryExpresssion(BinaryExpressionType type, BaseExpression leftExpression,
                                 BaseExpression rightExpression)
        {
            Type = type;
            LeftExpression = leftExpression;
            RightExpression = rightExpression;
        }

        public BaseExpression LeftExpression { get; set; }
        public BaseExpression RightExpression { get; set; }
        public BinaryExpressionType Type { get; set; }

        public override void Accept(ExpressionVisitor visitor)
        {
            visitor.Visit(this);
        }
    }

    public enum BinaryExpressionType
    {
        And,
        Or,
        NotEqual,
        LesserOrEqual,
        GreaterOrEqual,
        Lesser,
        Greater,
        Equal,
        Minus,
        Plus,
        Modulo,
        Div,
        Times,
        Pow
    }
}